{
    var director_item = document.getElementsByClassName('director_item');
    var temp = 3;
    var cn = true;
    var wrapper = document.getElementsByClassName('wrapper');
    var banner_item = document.getElementsByClassName('banner_item');
    var avatar = document.getElementById('avatar');
    var user_event = document.getElementById('user_event');
    var whole_wrapper = document.getElementById('whole_wrapper');
}
{
    var user_name;
    var preview=document.getElementById('preview');
    var user_name1=document.getElementById('user_name1');
    var gender1=document.getElementById('gender1');
    var direction1=document.getElementById('direction1');
    var term1=document.getElementById('term1');
    var home1=document.getElementById('home1');
    var constellation1=document.getElementById('constellation1');
    var birthday1=document.getElementById('birthday1');
    var id=document.getElementById('id');
    var psw=document.getElementById('psw');
    var tel=document.getElementById('tel');
    var qq=document.getElementById('qq');
    var wx=document.getElementById('wx');
    var email=document.getElementById('email');
    var info_motto1=document.getElementById('info_motto1');
    var pic1=document.getElementById('pic1');
    var pic2=document.getElementById('pic2');
    var pic3=document.getElementById('pic3');
}
//初始化
director_item[temp].style.backgroundColor = '#2F4399';
banner_item[temp].style.display = 'block';
document.getElementById("director").addEventListener("click", (event) => {
    if ([...director_item].includes(event.target)) {
        director_item[temp].style.backgroundColor = 'transparent';
        event.target.style.backgroundColor = '#2F4399';
        temp = [...director_item].indexOf(event.target);
        switch (temp) {
            case 0:
                banner_item[3].style.display = 'none';
                whole_wrapper.style.background='url(./img/main.png)';
                banner_item[0].style.display = 'block';
                break;
            case 1:
            case 2:
                window.location='../请假调研学页面/leave&adjust/leave&adjust/研学请假系统.html';
                break;
            case 3:
                banner_item[0].style.display = 'none';
                whole_wrapper.style.background='url(./img/background.png)';
                banner_item[3].style.display = 'block';
                break;
            case 4:
                window.location='./关于我们/关于我们/关于我们页面.html';
                break;
        }
    }
});
axios({
    url:'http://jp-tyo-ntt-1.natfrp.cloud:50928/Study_Leave_System_war_exploded/User_infoServlet',
    method:'post',
    headers:{
        "Content-Type":"application/json"
    },
}).then(response=>{
    console.log(response);
    let t=response.data.data;
    user_name=t.username;
    birthday1.value=t.birthday;
    constellation1.value=t.constellation;
    direction1.value=t.direction;
    gender1.value=t.gender;
    email.value=t.email;
    id.value=t.id;
    psw.value=t.password;
    tel.value=t.phone_num;
    qq.value=t.qQ;
    info_motto1.value=t.signature;
    term1.value=t.term;
    wx.value=t.wechat;
    home1.value=t.hometown;
    user_name1.innerText=user_name;
    document.getElementById('user_name2').innerText=`${direction1.value}-${term1.value}-${user_name}`;
}).catch(error=>{
    console.log(error);
})
avatar.onclick = function () {
    if (cn) {
        user_event.style.display = 'block';
        cn = false;
    } else {
        user_event.style.display = 'none';
        cn = true;
    }
};
user_event.onclick = () => {
    window.location='../登录注册页面/2022-2023寒假项目实战2.0/首页2.0.html';
};